<template>
	<view class="classify-view view-bg">
		<NavBar title="分类"></NavBar>
		<view class="list">
			<ThemeItem v-for="item in selectedTopicsList" :key="item._id" :item="item"></ThemeItem>
		</view>
	</view>
</template>

<script setup>
	import {
		getSelectedTopics
	} from '@/api/requestInterface.js'

	const selectedTopicsList = ref([])

	// 获取专题精选壁纸
	const loadSelectedTopics = async () => {
		const {
			errCode,
			data
		} = await getSelectedTopics({
			pageNum: 1,
			pageSize: 15
		})

		if (errCode === 0) {
			selectedTopicsList.value = data
		} else {
			selectedTopicsList.value = []
		}
	}

	loadSelectedTopics()
</script>

<style lang="scss" scoped>
	.classify-view {
		padding: 0 30rpx;

		.list {
			display: grid;
			grid-gap: 30rpx;
			grid-template-columns: repeat(3, 1fr);
		}
	}
</style>